//
//  CommonUtil.h
//  兼职页面
//
//  Created by kuiyuan liang on 2021/5/22.
//

#import <Foundation/Foundation.h>
#import "StatisticsViewController.h"
#import "ForumViewController.h"
#import "UIView+Frame.h"
#import "HudFactory.h"
#import "PlaceholderView.h"

#define TestImageURL @"https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimg.boqiicdn.com%2FData%2FBK%2FP%2Fimg57991418291533.jpg&refer=http%3A%2F%2Fimg.boqiicdn.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1624960802&t=4c3d3f51f2f72abf7544fa917cd178a6"

/**
 *  获取系统版本号
 */
#define SYSTEM_VERSION  ([UIDevice currentDevice].systemVersion.floatValue)

/**
 * 屏幕物理尺寸的高
 */
#define SCREEN_HEIGHT ([UIScreen mainScreen].bounds.size.height)

/**
 * 屏幕物理尺寸的宽
 */
#define SCREEN_WIDTH ([UIScreen mainScreen].bounds.size.width)

#define AD(x) ((SCREEN_WIDTH/375)*(x))



#define kIs_iPhoneX SCREEN_WIDTH >=375.0f && SCREEN_HEIGHT >=812.0f
 
/*状态栏高度*/
#define kStatusBarHeight (CGFloat)(kIs_iPhoneX?(44.0):(20.0))
/*导航栏高度*/
#define kNavBarHeight (44)
/*状态栏和导航栏总高度*/
#define kNavBarAndStatusBarHeight (CGFloat)(kIs_iPhoneX?(88.0):(64.0))
/*TabBar高度*/
#define kTabBarHeight (CGFloat)(kIs_iPhoneX?(49.0 + 34.0):(49.0))
/*顶部安全区域远离高度*/
#define kTopBarSafeHeight (CGFloat)(kIs_iPhoneX?(44.0):(0))
/*底部安全区域远离高度*/
#define kBottomSafeHeight (CGFloat)(kIs_iPhoneX?(34.0):(0))
/*iPhoneX的状态栏高度差值*/
#define kTopBarDifHeight (CGFloat)(kIs_iPhoneX?(24.0):(0))
/*导航条和Tabbar总高度*/
#define kNavAndTabHeight (kNavBarAndStatusBarHeight + kTabBarHeight)

#define RGB(r,g,b) ([UIColor colorWithRed:r/255.0 green:g/255.0 blue:b/255.0 alpha:1])

#define RandomColor           RGB(arc4random_uniform(255), arc4random_uniform(255), arc4random_uniform(255))
@interface CommonUtil : NSObject

// 给label设置多图片
+ (void)setText:(NSString *)text
    frontImages:(NSArray<UIImage *> *)images
      imageSpan:(CGFloat)span
          label:(UILabel *)label;


// 计算label高度
+ (CGFloat)countHeight:(NSString *)content font:(UIFont *)font width:(CGFloat)width;
// 计算label宽度
+ (CGFloat)countWidth:(NSString *)content font:(UIFont *)font height:(CGFloat)height;

+ (void)setupPlaceholderView:(UITableView *)tableView models:(NSArray *)models;
@end


